package com.Q.podcastq.BD;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;


public class BD extends SQLiteOpenHelper{
	private String titles;
	private String author ;
	private String summary ;
	private String pubdate ;
	private String duration ;
	private String link ;
	private String URL ;
	private String id ;
	private String foto ;
	
	String Podcasts = "CREATE TABLE PODCAST (" +
			"id INTEGER primary key, " +
			"titulo TEXT, " +
			"author TEXT, " +
			"summary TEXT, " +
			"fecha TEXT, " +
			"duracion INTEGER, " +
			"url TEXT, " +
			"foto TEXT, " +
			"descargado INTEGER, " +
			"fotodescargada INTEGER, " +
			"link TEXT)";
	String Comentarios = "CREATE TABLE COMENTARIOS (" +
			"id INTEGER, " +
			"podcast INTEGER, " +
			"nombre TEXT, " +
			"comentario TEXT)";




	static SQLiteDatabase db;


	public BD(Context context, String name, CursorFactory factory, int version) {
		super(context, name, factory, version);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		BD.db = db;
		db.execSQL(Podcasts);
		db.execSQL(Comentarios);


	}
	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub
		db.execSQL("DROP TABLE IF EXISTS PODCAST");
		db.execSQL("DROP TABLE IF EXISTS COMENTARIOS");
		onCreate(db);
	}




}
